{% extends "bookmarks/base.html" %}

{% load i18n %}

{% block head_title %}{% blocktrans %}Your Bookmarks{% endblocktrans %}{% endblock %}

{% block body %}
<h1>{% trans "Your Bookmarks" %}</h1>
    
{% if bookmark_instances %}
<table class="bookmarks narrow">
  {% for bookmark_instance in bookmark_instances %}
  <tr class="{% cycle odd,even %}">
    <td class="meta">
      <div class="date">{{ bookmark_instance.bookmark.added|date }}</div>
      <div class="details">{{ bookmark_instance.bookmark.adder }}</div>
    </td>
    <td>
      <h2><a href="{{ bookmark_instance.bookmark.url }}">{{ bookmark_instance.description }}</a></h2>
      {% ifnotequal bookmark_instance.bookmark.adder request.user %}
        <div class="save">saved by you on {{ bookmark_instance.saved|date }}.</div>
      {% endifnotequal %}
      {% if bookmark_instance.note %}
        <div class="body">{{ bookmark_instance.note|linebreaks }}</div>
      {% endif %}
        <div class="url">
	  {% if bookmark_instance.bookmark.get_favicon_url %}
	    <img src="{{ bookmark_instance.bookmark.get_favicon_url }}" height="16" width="16"/> 
	  {% endif %}
	  {{ bookmark_instance.bookmark.url }}
	</div>

        <form method="POST" action="{% url delete_bookmark_instance bookmark_instance.id %}">
          <input type="submit" value="{% trans "Delete Bookmark" %}" />
          <input type="hidden" name="next" value="{{ request.path }}" />
        </form>
                        
    </td>
  </tr>
  {% endfor %}
</table>
{% else %}
  <p>{% trans "No bookmarks yet." %}</p>
{% endif %}
    
{% endblock %}
